package com.hns.phone.safety.service;

import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hns.can.common.aop.orgTree.DriverInterfaceAnnotation;
import com.hns.can.common.aop.orgTree.LeftOrgAnnotation;
import com.hns.can.common.constants.GlobalConst;
import com.hns.can.common.formula.FillCodeDscValue;
import com.hns.can.common.formula.FillParamsVo;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.phone.entity.CommCarSpdingEntity;
import com.hns.tool.pub.SearchConditionVo;

@Service
public class PhoneOverSpeedService extends CommonService {
	
	@Autowired
    private FillCodeDscValue codeDscValue;
	
	/**
     * @param conditionVo
     * @param request
     * @return
     * @throws Exception
     * @author:JeffXu
     * @email:835264047@qq.com
     * @创建日期:2014-7-11
     * @功能说明：获取超速信息的page对象
     */
    @Transactional
    public Pagination searchOverspeedPage(SearchConditionVo conditionVo, HttpServletRequest request) throws Exception {
        Pagination page = this.myBatisPage("phoneOverSpeed.getOverspeedCnt", "phoneOverSpeed.getOverspeedList", conditionVo,  CommCarSpdingEntity.class);
        List<Object> list = page.getData();
        //公式注入
//        HashMap<String, String> map = new HashMap<String, String>();
//        map.put("drvName", GlobalConst.DEFAULT_CACHE_VALUE);
//        FillParamsVo vo1 = new FillParamsVo("drvId", map);
        
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("licPltNo", GlobalConst.DEFAULT_CACHE_VALUE);
        FillParamsVo vo2 = new FillParamsVo("carId", map);
        
        map = new HashMap<String, String>();
        map.put("lineName", GlobalConst.DEFAULT_CACHE_VALUE);
        FillParamsVo vo3 = new FillParamsVo("lineId", map);
        
//        map = new HashMap<String, String>();
//        map.put("organName", GlobalConst.DEFAULT_CACHE_VALUE);
//        FillParamsVo vo4 = new FillParamsVo("organId", map);
        
        codeDscValue.fillInfoValue(list, new String[]{GlobalConst.CACHE_KEY_BASE_CAR_INFO,GlobalConst.CACHE_KEY_BASE_LINE_INFO}, vo2, vo3);
        page.setData(list);
        return page;
    }
}
